<template>
  <div class="gedanbox" v-if="detail" @click="$router.push(`/gedanview?id=${id}`)">
    <div class="gedanmodel">
      <img :src="detail.coverImgUrl" alt="" />
      <div class="mask"></div>
      <div class="icon">
        <span class="iconfont icon-yinlefuhao1"></span>
      </div>

      <div class="bottomleft">
        <div class="theme" v-if="select == 1">
          <span class="iconfont icon-hashjinghao"></span>
          <span>{{detail.tags[0]}}</span>
        </div>
        <div class="user" v-else-if="select == 2">
          <div class="mask"></div>

          <img :src="detail.creator.avatarUrl" alt="" />
          <span>{{detail.creator.nickname}}</span>
        </div>
      </div>
    </div>
    <div class="gendandescription" v-if="bottominfo">
      <span> {{detail.description}} </span>
    </div>
  </div>
</template>

<script>
import {get} from '../../http/request'
export default {
  props: ["id","select",'bottominfo'],
  data() {
    return {
      usercover: 1,
      detail:null
    };
  },
  mounted(){
    get(`/playlist/detail?id=${this.id}`).then(res=>{

        // console.log(res);

        this.detail=res.data.playlist

        // console.log('歌单',this.detail);

    })
  }
};
</script>

<style lang="scss" scoped>
$color: #fff;
$banxin: 690rem;
$theme: #f8e24a;

.gedanmodel {
  
  width: 340rem;
  height: 360rem;
  background-color: #1a1a1a;
  border-radius: 10rem;
  color: #fff;
  position: relative;

  img {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 340rem;
    height: 340rem;
    border-radius: 25rem;
  }
  .mask {
    position: absolute;
    z-index: 2;
    // background-image:radial-gradient(#333,#000);
    opacity: 0.2;
    top: 0;
    left: 0;
    width: 340rem;
    height: 340rem;
    background-color: #1a1a1a;
    border-radius: 10rem;
  }
  .icon {
    position: absolute;
    z-index: 3;
    bottom: 30rem;
    right: 0rem;
    margin-right: 20rem;
    width: 35rem;
    height: 35rem;
    border-radius: 35rem;
    background-color: #fff;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.8;

    span {
      font-size: 32rem;
      font-weight: 100;
      color: #59502e;
      // opacity: 0.5;
      // opacity: 0.4;
    }
  }
  .bottomleft {
    position: absolute;
    z-index: 3;
    color: #fff;
    bottom: 0;

    .theme {
      width: 100rem;
      height: 60rem;
      border-radius: 60rem;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: $theme;
      color: #100000;
      font-size: 20rem;
      position: relative;
      bottom: 0rem;

      span {
        font-size: 20rem;
        font-weight: 900;
      }
    }
    .user {
      color: #fff;
      width: 200rem;
      height: 60rem;
      border-radius: 60rem;
      box-sizing: border-box;
      display: flex;
      justify-content: space-between;
      align-items: center;
      display: flex;
      justify-content: center;
      align-items: center;
      color: #100000;
      font-size: 20rem;
      z-index: 10;
      //  background-color: red;
      position: relative;
      overflow: hidden;
      bottom: 20rem;

      .mask {
        width: 200rem;
        height: 60rem;
        position: absolute;
        top: 0;
        z-index: 999;
        background-color: #fff;
      }

      img {
        position: absolute;
        top: 6rem;
        left: 5rem;
        z-index: 2;
        width: 50rem;
        height: 50rem;
        border-radius: 50rem;
      }
      span {
         position: absolute;
         left: 60rem;
        color: #f7f4f1;
        font-weight: 500;
      }
    }
  }
}

// 歌单底部描述
.gendandescription {
  
  z-index: 10;
  width: 340rem;
//   bottom: -20;
  color: #f7f4f1;
  margin-top: 30rem;
  width: 340rem;
  display: flex;
  justify-content: start;
  align-items: center;
  height: 65rem;
  span{
      overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp:1;  /* 设置行数 */
	-webkit-box-orient: vertical;
       font-size: 30rem;
    font-weight: 600;
    color: #c6c6c6;
    text-align: left;
  }
}
.slotcontent {
  span {
    color: #fff;
   
  }
}
.gedanbox{
    width: 340rem;
    // height: 590rem;
    
}
</style>
